package cn.yy.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Year entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "year", catalog = "phoneerp")
public class Year implements java.io.Serializable {

	// Fields

	private Integer yearId;
	private String year;
	private Set<Profit> profits = new HashSet<Profit>(0);
	private Set<AccountInOldchart2> accountInOldchart2s = new HashSet<AccountInOldchart2>(
			0);
	private Set<Wages> wageses = new HashSet<Wages>(0);
	private Set<Bonus> bonuses = new HashSet<Bonus>(0);
	private Set<Reposity> reposities = new HashSet<Reposity>(0);
	private Set<Financialposition> financialpositions = new HashSet<Financialposition>(
			0);
	private Set<Cash> cashs = new HashSet<Cash>(0);

	// Constructors

	/** default constructor */
	public Year() {
	}

	/** minimal constructor */
	public Year(String year) {
		this.year = year;
	}

	/** full constructor */
	public Year(String year, Set<Profit> profits,
			Set<AccountInOldchart2> accountInOldchart2s, Set<Wages> wageses,
			Set<Bonus> bonuses, Set<Reposity> reposities,
			Set<Financialposition> financialpositions, Set<Cash> cashs) {
		this.year = year;
		this.profits = profits;
		this.accountInOldchart2s = accountInOldchart2s;
		this.wageses = wageses;
		this.bonuses = bonuses;
		this.reposities = reposities;
		this.financialpositions = financialpositions;
		this.cashs = cashs;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "yearId", unique = true, nullable = false)
	public Integer getYearId() {
		return this.yearId;
	}

	public void setYearId(Integer yearId) {
		this.yearId = yearId;
	}

	@Column(name = "year", nullable = false, length = 10)
	public String getYear() {
		return this.year;
	}

	public void setYear(String year) {
		this.year = year;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "year")
	public Set<Profit> getProfits() {
		return this.profits;
	}

	public void setProfits(Set<Profit> profits) {
		this.profits = profits;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "year")
	public Set<AccountInOldchart2> getAccountInOldchart2s() {
		return this.accountInOldchart2s;
	}

	public void setAccountInOldchart2s(
			Set<AccountInOldchart2> accountInOldchart2s) {
		this.accountInOldchart2s = accountInOldchart2s;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "year")
	public Set<Wages> getWageses() {
		return this.wageses;
	}

	public void setWageses(Set<Wages> wageses) {
		this.wageses = wageses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "year")
	public Set<Bonus> getBonuses() {
		return this.bonuses;
	}

	public void setBonuses(Set<Bonus> bonuses) {
		this.bonuses = bonuses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "year")
	public Set<Reposity> getReposities() {
		return this.reposities;
	}

	public void setReposities(Set<Reposity> reposities) {
		this.reposities = reposities;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "year")
	public Set<Financialposition> getFinancialpositions() {
		return this.financialpositions;
	}

	public void setFinancialpositions(Set<Financialposition> financialpositions) {
		this.financialpositions = financialpositions;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "year")
	public Set<Cash> getCashs() {
		return this.cashs;
	}

	public void setCashs(Set<Cash> cashs) {
		this.cashs = cashs;
	}

}